1. Field of the Invention
The present invention relates to a method and an apparatus for character font generation within limitation of character output media, and a computer readable storage medium storing a character font generation program. More particularly, it relates to a method and an apparatus for character font generation and a computer readable storage medium storing a character font generation program, for simplifying a collection of strokes constituting a character according to the limitation of output media receiving the character.
2. Description of the Background Art
In Nikkei Electronics, 1997. 4. 7 (no. 686), p.137-147, a technique for developing a multi-gray scale Japanese font in dots by a method of surface integral is described.
In the method of surface integral, a gray-scale value of a character is determined with use of an outline of the character, by first obtaining a correction value based on a value of an area surrounded by the outline in each pixel, and then determining a final gray-scale value by adding the correction value to a predetermined basic gray-scale value.
A method of developing dots with an intermediate gray-scale, such as the above mentioned method of surface integral, however, cannot be employed when the gray-scale level of dot is insufficient and in some cases a generated character may be crushed or blurred as a whole and becomes illegible.
An object of the present invention is, therefore, to provide a method and an apparatus for character font generation capable of generating a character font allowing an output of an easily recognizable character, regardless of any limitation of character output media; and a computer readable storage medium storing a character font generation program.
To achieve the above mentioned object, the method of character font generation according to the present invention includes the steps of determining whether a character can be output in a desired font to an output unit having a predetermined resolution, and of omitting a stroke of the character so as to make the size of the character a size permitting output thereof according to the predetermined resolution, in response to determining that a character cannot be output. The omission in the step of omitting is performed so as to maintain the balance of the character and preserve the shape (contour) of the character.
Thus, the stroke is omitted to allow the output of the character according to the resolution of the output unit while the balance of the character is maintained and the shape (contour) of character is preserved. Therefore, the character can be output without being limited by the resolution of the output unit.
In addition, even though the stroke of the character is omitted, as the balance and the shape (contour) thereof are maintained, the typeface is preserved in the output character and the visibility of the character is not deteriorated.
The method of character font generation described above may further include a reduction step and a generation step in the step of omitting.
In the reduction step, the character is reduced until each stroke of the character comes into contact with one of another stroke, a circumscribing frame containing a body size area of the character and a splitting frame splitting the body size area into a plurality of character areas based on the configuration of the character.
In the generation step, a character area balance database (hereinafter also referred to as DB) including a ratio of the size of the splitting frame to the size of the circumscribing frame and contact information regarding manner of contact of a stroke with each line of splitting frame in each splitting frame for each character area is generated based on the result of reduction in the reduction step.
In addition, in the step of omitting, which stroke of the character is to be omitted is determined based on the contact information and the stroke is omitted until the size of the character becomes the size allowing output thereof, while the ratio of the size of each character area in the character area balance database is maintained.
Thus, the omission of the stroke in the step of omitting is performed based on the contact information while the ratio of the size of splitting frame to the size of circumscribing frame of each character area indicating the balance of the character is maintained. Therefore, the balance of the character, that is a typeface, is maintained without being changed in the omission process of the stroke. In addition, as the omission of the stroke is performed according to the contact information of each splitting frame, a stroke relating to the shape (contour) of the character is easily and securely maintained.
The contact information according to the method of character font generation described above may include a number of contacts between an edge portion of the stroke and the splitting frame line, a number of contacts between an edge line having a length corresponding to the width of the stroke and the splitting frame line and a number of contacts between a lengthwise line of the stroke and the splitting frame line.
Thus, which stroke is to be omitted can be determined based on the number of contacts between the edge portion of the stroke and the splitting frame line, the number of contacts between the edge line corresponding to the stroke width and the splitting frame line and the number of contacts between the lengthwise line of the stroke and the splitting frame line. Therefore, the priority (weighting) of the stroke omission can be flexibly determined case by case, and the output character with strokes omitted and superior visibility can be readily obtained.
In the determination of the stroke to be omitted described above, when the contact information indicates the contact of the lengthwise line of the stroke and the splitting frame line, if the distance between the character and the circumscribing frame line is shortest at this lengthwise line of the stroke, the stroke will not be omitted. Otherwise, the omission of the stroke may be determined based on the contact information of the adjacent stroke.
Hence, when the lengthwise line of the stroke contacts with the splitting frame line and the distance between the character and the circumscribing frame is shortest at this lengthwise line, the stroke is determined not to be omitted. In other words, the stroke relating to the shape (contour) of the character is determined to be preserved. Otherwise, the omission is determined based on the contact information of the adjacent stroke. In other words, the weighting regarding the omission of the inner stroke of the character is determined in detail.
Thus, the stroke can be omitted to provide an improved visibility while the shape (contour) of the character is securely preserved.
In the desired font mentioned above, the stroke width of the character can be set according to the total number of the strokes of the character.
Thus, the stroke width in the output character font is set according to the total number of the strokes. Therefore, at the output of the character, a uniform density of color can be obtained for all characters regardless of the total number of the strokes, whereby the visibility is improved.
One of a plurality of splitting patterns previously prepared is applied for splitting the body size area as described above based on the configuration of the character, and the plurality of splitting patterns may be generated as combinations of at least one specific splitting pattern.
Thus, the plurality of splitting patterns are each prepared as a combination of a specific splitting pattern. Therefore, preparation of a specific splitting pattern alone and not the plurality of splitting patterns is required, whereby the storage capacity necessary for preparing the splitting pattern is reduced.
The apparatus for character font generation according to the present invention includes a determination unit for determining whether a character can be output in a desired font to an output unit having a predetermined resolution, and an omission unit for omitting a stroke of the character so as to make the size of the character the size allowing output thereof according to the predetermined resolution according to the determination of xe2x80x9coutput not allowedxe2x80x9d by the determination unit. The omission is performed so as to maintain the balance of the character and preserve the shape (contour) of the character.
Thus, the stroke is omitted to allow the output of the character according to the resolution of the output unit while the balance of the character is maintained and the shape (contour) of character is preserved. Therefore, the character can be output without being limited by the resolution of the output unit.
In addition, even though the stroke of the character is omitted, as the balance and the shape (contour) thereof are maintained, the typeface is preserved also in the output character and the visibility of the character is not deteriorated.
In the apparatus for character font generation described above, the omission unit may includes a reduction unit and a generation unit as set forth below.
The reduction unit reduces the character until each stroke of the character comes into contact with one of another stroke, and includes a circumscribing frame containing a body size area of the character and a splitting frame for splitting the body size area into a plurality of character areas based on the configuration of the character. The generation unit generates a character area balance database including a ratio of the size of the splitting frame to the size of the circumscribing frame and contact information regarding a manner of contact of a stroke with each line of splitting frame in each splitting frame for each character area based on the result of reduction by the reduction unit. The omission unit, thus determines which stroke of the character is to be omitted based on the contact information and omits the stroke until the size of the character becomes the size allowing output thereof, maintaining the ratio of the size of each character area in the character area balance database.
Thus, the omission of the stroke by the omission unit is performed based on the contact information while the ratio of the size of splitting frame to the size of circumscribing frame of each character area indicating the balance of the character is maintained. Therefore, the balance of the character, that is the typeface, is maintained without being changed in the omission process of the stroke. In addition, as the omission of the stroke is performed according to the contact information of each splitting frame line, a stroke relating to the shape (contour) of the character is easily and securely maintained.
The contact information in the apparatus of character font generation described above may include the number of contacts between an edge portion of the stroke and the splitting frame line, the number of contacts between an edge line having a length corresponding to the width of the stroke and the splitting frame line and the number of contacts between a lengthwise line of the stroke and the splitting frame line.
Thus, which stroke is to be omitted can be determined based on the number of contacts between the edge portion of the stroke and the splitting frame line, the number of contacts between the edge line corresponding to the stroke width and the splitting frame line and the number of contacts between the lengthwise line of the stroke and the splitting frame line. Therefore, the priority (weighting) of the stroke omission can be flexibly determined case by case, and the output character with strokes omitted and superior visibility can be readily obtained.
In the determination of the stroke to be omitted in the apparatus for character font generation described above, when the contact information indicates the contact of the lengthwise line of the stroke and the splitting frame line, if the distance between the character and the circumscribing frame line is shortest at this lengthwise line of the stroke, the stroke will not be omitted and otherwise the omission of the stroke may be determined based on the contact information of the adjacent stroke.
Hence, when the lengthwise line of the stroke contacts with the splitting frame line and the distance between the character and the circumscribing frame is shortest at this lengthwise line, the stroke is determined not to be omitted. In other words, the stroke relating to the shape (contour) of the character is determined to be preserved. Otherwise, the omission is determined based on the contact information of the adjacent stroke. The weighting regarding the omission is determined in detail.
Thus, the stroke can be omitted to provide an improved visibility while the shape (contour) of the character is securely preserved.
In the desired font in the apparatus for character font generation mentioned above, the stroke width of the character can be set according to the total number of the strokes of the character.
Thus, the stroke width in the output character font is set according to the total number of the strokes. Therefore, at the output of the character, a uniform density of color can be obtained for all characters regardless of the total number of the strokes whereby the visibility is improved.
In the apparatus for character font generation described above, one of a plurality of splitting patterns previously prepared is applied for splitting the body size area as described above based on the configuration of the character, and the plurality of splitting patterns may be generated as combinations of at least one specific splitting pattern.
Thus, the plurality of splitting patterns are each prepared as a combination of at least one specific splitting pattern. Therefore, preparation of a specific splitting pattern alone and not the plurality of splitting patterns is required, whereby the storage capacity of the apparatus necessary for preparing the splitting pattern is reduced.
In the computer readable storage medium storing a character font generation program for causing a computer to perform the method of character font generation according to the present invention, the method of character font generation includes the steps of determining whether a character can be output in a desired font to an output unit having a predetermined resolution, and, of omitting a stroke of the character so as to make the size of the character the size allowing output thereof according to the predetermined resolution according to the determination of xe2x80x9coutput not allowedxe2x80x9d in the step of determining. The omission is performed so as to maintain the balance of the character and preserve the shape of the character.
Thus, the stroke is omitted to allow the output of the character according to the resolution of the output unit while the balance of the character is maintained and the shape of character is preserved. Therefore, the character can be output without being limited by the resolution of the output unit.
In addition, even though the stroke of the character is omitted, as the balance and the shape thereof are maintained, the typeface is preserved also in the output character and the visibility of the character is not deteriorated.
In the computer readable storage medium storing a character font generation program for causing a computer to perform the method of character font generation described above, the step of omitting in the method of character font generation may further includes a reduction step and a generation step. In the reduction step, the character is reduced until each stroke of the character comes into contact with one of another stroke, a circumscribing frame containing a body size area of the character and a splitting frame splitting the body size area into a plurality of character areas based on the configuration of the character. In the generation step, a character area balance database including a ratio of the size of the splitting frame to the size of the circumscribing frame for each character area and contact information regarding a manner of contact of a stroke with each line of splitting frame in each splitting frame is generated based on the result of reduction in the reduction step. In addition, in the step of omitting, which stroke of the character is to be omitted is determined based on the contact information and the stroke is omitted until the character becomes the size allowing output thereof while the ratio of the size of each character area in the character area balance database is maintained.
Thus, the omission of the stroke in the step of omitting is performed based on the contact information while the ratio of the size of splitting frame to the size of circumscribing frame of each character area indicating the balance of the character is maintained. Therefore, the balance of the character, that is the typeface, is maintained without being changed in the omission process of the stroke. In addition, as the omission of the stroke is performed according to the contact information of each splitting frame, a stroke relating to the shape (contour) of the character is easily and securely maintained.
The foregoing and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.